{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0cb9acd1",
   "metadata": {},
   "outputs": [],
   "source": [
    "def greet_user():\n",
    "    \"\"\"问候语函数\"\"\"\n",
    "    print(\"hello world\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "32dac81f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "greet_user()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "56a41e85",
   "metadata": {},
   "outputs": [],
   "source": [
    "def greet_user(username):\n",
    "    \"\"\"问候语函数\"\"\"\n",
    "    print(\"hello\",username)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "e74905da",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello cc\n"
     ]
    }
   ],
   "source": [
    "greet_user(\"cc\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 31,
   "id": "674fbfc3",
   "metadata": {},
   "outputs": [],
   "source": [
    "import nfu_crawl"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 32,
   "id": "257f0d5b",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on function NFU_NEWS_URL in module nfu_crawl:\n",
      "\n",
      "NFU_NEWS_URL(分类页码)\n",
      "    可以快速查询广州南方学院新闻的页面链接\n",
      "    分类:[\"xxyw\",\"xydt\",\"tzgg\",\"ztb\",\"gxdt\"]\n",
      "    页码：[113，106，37，27，29]\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(nfu_crawl.NFU_NEWS_URL)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "09735af3",
   "metadata": {},
   "outputs": [
    {
     "ename": "TypeError",
     "evalue": "NFU_NEWS_URL() takes 1 positional argument but 2 were given",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
      "Input \u001b[0;32mIn [28]\u001b[0m, in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mnfu_crawl\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mNFU_NEWS_URL\u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mxydt\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\u001b[38;5;241;43m106\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "\u001b[0;31mTypeError\u001b[0m: NFU_NEWS_URL() takes 1 positional argument but 2 were given"
     ]
    }
   ],
   "source": [
    "nfu_crawl.NFU_NEWS_URL(\"xydt\",106)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 33,
   "id": "6870b36f",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "invalid syntax (2100223509.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  Input \u001b[0;32mIn [33]\u001b[0;36m\u001b[0m\n\u001b[0;31m    def describe_pet(animal_type.pet_name):\u001b[0m\n\u001b[0m                                ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
     ]
    }
   ],
   "source": [
    "def describe_pet(animal_type.pet_name):\n",
    "    \"\"\"显示宠物信息\"\"\"\n",
    "    print(\"\\ni\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "75b622de",
   "metadata": {},
   "source": [
    "# 1.关于实参和形参"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 34,
   "id": "3af7e603",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "positional argument follows keyword argument (3262699902.py, line 5)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;36m  Input \u001b[0;32mIn [34]\u001b[0;36m\u001b[0m\n\u001b[0;31m    func_test(x=1,2)\u001b[0m\n\u001b[0m                   ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m positional argument follows keyword argument\n"
     ]
    }
   ],
   "source": [
    "def dunc_test(x,y):\n",
    "    print(x)\n",
    "    print(y)\n",
    "    \n",
    "func_test(x=1,2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f11e8497",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.13"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
